<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<link rel="stylesheet" type="text/css" href="css/admin.css" />
	<link rel="stylesheet" type="text/css" href="css/common.css" />
	<script src="<%=basePath%>js/sys/turnPage.js" type="text/javascript"></script>
	<script type="text/javascript">
		function goTo(){
			var page=document.getElementById("page").value;
			if(page==""){
				alert("页数不能为空!");
				return false ;
			}
			if (page.length > 0){
                var regu = /^[-]{0,1}[0-9]{1,}$/; 
                if(!regu.test(page)){
                   alert("您输入的页码必须为数字");
                   return false;
                }
            }
			location.href="<%=basePath%>/admin/system/userMgr/userMgr!listUserRole.action?active=<s:property value='condition.active'/>&name=<s:property value='condition.name'/>&number=<s:property value='condition.number'/>&orderBy=<s:property value='orderBy'/>&orderByType=<s:property value='orderByType'/>&pageSize=<s:property value='pageSize'/>&currentPage="+page;
		}
	</script>
	<style type="text/css">
	 .linkUseless{poorfish:expression(this.onclick=function kill(){return false})}
	</style>
  </head>
  <body>
  <table width="95%" border="0" align="center" cellspacing="0">
  <tr>
    <td><form id="form1" name="form1" method="post" action="<%=basePath%>/admin/system/userMgr/userMgr!listUserRole.action">
      <table width="100%" class=TableList style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 100%; BORDER-RIGHT-WIDTH: 0px">
        <tr>
          <td colspan="12">
          		<br/>
          		用户名：<input name="username" type="text" id="username" maxlength="25" value="<s:property value='username'/>" 
          		onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
				onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
				&nbsp;&nbsp;
				姓名：<input name="name" type="text" id="name" maxlength="25" value="<s:property value='name'/>" 
          		onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
				onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
				&nbsp;&nbsp;
				所属部门：<input name="dept_name" type="text" maxlength="25" id="dept_name" value="<s:property value='dept_name'/>" 
				onfocus="currentBackgroundColor=this.style.backgroundColor;this.style.background='#FFFF99';" 
				onblur="this.style.backgroundColor=currentBackgroundColor;" style="height: 25px;"/>
				
				&nbsp;&nbsp;&nbsp;&nbsp;
          		<input type="submit" name="Submit" value="查询" class="Button"/>
          		&nbsp;&nbsp;&nbsp;&nbsp;
          		<input type="reset" name="Reset" value="重置" class="Button"/>
          		<input type="hidden" id="currentPage" name="currentPage" value="${currentPage}"/>
          		<input type="hidden" id="pageSize" name="pageSize" value="${pageSize}"/>
          		<input type="hidden" id="orderBy" name="orderBy" value="${orderBy}"/>
          		<input type="hidden" id="orderByType" name="orderByType" value="${orderByType}"/>
          		<input type="hidden" id="totalPage" name="totalPage" value="${condition.totalPage}"/>
          	</td>
          </tr>
          <tr>
      		<td colspan="12"><hr/></td>
      		</tr>
         <tr>
         <td colspan="12">
         <table width="100%" border="1"  class=TableList style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; WIDTH: 100%; BORDER-RIGHT-WIDTH: 0px">
         <tr bgcolor="#EAEEF4">
         	<td align="center"  width="5%"><strong>序号</strong></td>
         	<td align="center"><strong>所属部门</strong></td>
          	<td align="center"  ><strong>用户名</strong></td>
          	<td align="center"  ><strong>姓名</strong></td>
          	<td align="center"  ><strong>对应的角色</strong></td>
		</tr>
		<s:set name="index" value="(condition.currentPage-1)*condition.pageSize+1"/>
        <s:iterator value="result" id="bean" status="flag">
			<tr  class=<s:if test="#flag.even">Row1 onMouseOver="this.className='SelRow'" onMouseOut="this.className='Row1'"</s:if><s:else>Row0 onMouseOver="this.className='SelRow'" onMouseOut="this.className='Row0'"</s:else> >
				<td align="center" width="5%"><s:property value="#flag.index+#index" /></td>
				<td align="center"><s:property value="#bean.dept_name" /> </td>
				<td align="center"><s:property value="#bean.username" /></td>
				<td align="center"><s:property value="#bean.name" /> </td>
				<td align="center"><a href="<%=basePath%>/admin/system/userMgr/userMgr!toEditUserRole.action?id=<s:property value='#bean.id'/>">对应的角色</a></td>
       		</tr>
        </s:iterator>
          
        <tr>
          <td colspan="12" bgcolor="#EEF0F2"><table width="100%" border="0">
            <table width="100%" border="0">
         		<tr>
	              <td>
		              [<a onclick="turnPage('1','form1');">首页</a> ]
		              [<a <s:if test="currentPage<=1">class="linkUseless" disabled="disabled"</s:if> onclick="turnPage('2','form1');">上一页</a> ]
		              [<a <s:if test="currentPage>=condition.totalPage">class="linkUseless" disabled="disabled"</s:if> onclick="turnPage('3','form1');">下一页</a> ]
		              [<a onclick="turnPage('4','form1');">尾页</a>]
	              </td>
	              <td>&nbsp;</td>
	              <td>第<s:property value="condition.currentPage"/>页/共<s:property value="condition.totalPage"/>页  共 <s:property value="condition.total"/> 条记录&nbsp;&nbsp;每页<s:property value="condition.pageSize"/>行</td>
	              <td align="right">  转到
	                <input type="text" id="page" name="page" value="${currentPage}" style="width:20px" />
						页
					<input id="button" name="Input" type="button" style="width:25px" value="GO" onclick="turnPage('5','form1');"/>
				  </td>
				 </tr>
			</table>
          </td>
          </tr>
         </table>
         </td>
         </tr>
      </table>
        </form>
    </td>
  </tr>
</table>
</body>
</html>
